Literate programming
University of Luxembourg
Thursday, the 14th of November, 2024
Quarto: an open-source scientific and technical publishing system
Literate programming is the practice of mixing code and descriptive writing in order to execute and explain a data analysis simultaneously in the same document.
— William Landau Developer of {targets}
For a bioinformatician, pure programming is barely happening, we need reports/websites where content and formatting are disconnected
Source: {targets} user manual
Predecessor of Quarto.
Version 1 in 2016, the idea was to have text and code in one document, execute code and let the final markdown converted to different formats by pandoc.
Jupyter notebook were also exploring the same concept. Rendering order led sometimes to some frustration
Credit: Artwork by Allison Horst
<!DOCTYPE html>
<html>
<body>
<h1>This is a heading</h1>
<p>This is some text in a <b>paragraph</b></p>
<h2>This is a second level heading</h2>
<ul>
<li><a href="http://exa.com"><code>site</code></a>
<li><img src="https://images.computerhistory.org/revonline/images/500004391-03-01.jpg?w=200">
</ul>
</body>
</html>Extended Rmarkdown. Languages and Integrated Development Environment agnostic
.qmd) document to various formats (PDF, HTML…)knitrYAML header
Free text in Markdown
Code chunks
Code to be interpreted
knitr for jupyter for docx)How to add equations
Enclose in $ for in-line equations
$a^2+b^2=c^2$ renders as \(a^2+b^2=c^2\).
Double ($$) for separate equations.
$$G_{\mu v}=8 \pi G (T_{\mu v} + \rho _\Lambda \ g_{\mu v}) $$
renders as:
\[G_{\mu v}=8 \pi G (T_{\mu v} + \rho _\Lambda \ g_{\mu v})\]
shiny apps (using CI scheduled pipelines)Command to add an extensions among many available (+165 references)
dlsm-bioinfo/
├── bioinfo.qmd
├── dag-atac-seq.png
├── dag-rna-seq.png
├── insert-citation.png
├── orbi-bib-export.png
├── _extensions
│ └── quarto-journals
│ └── plos/
├── gaigneaux.bib
├── ginolhac.bib
├── references.bib
├── plos2015.bst <- bib style
├── _manuscript/ <- outputs
└── _quarto.yml <- main configDemo HTML output
PLoS PDF example:
Summary
Quarto (qmd)Markdownrender to different output formatsFurther reading 📚
Acknowledgments 🙏 👏
Thank you for your attention!